// Abstraction 接口
interface Abstraction {
    void operation();
}

// Implementor 接口
interface Implementor {
    void operationImpl();
}

// RefinedAbstraction 类
abstract class RefinedAbstraction implements Abstraction {
    Implementor implementor;
    
    public RefinedAbstraction(Implementor implementor) {
        this.implementor = implementor;
    }
    
    public void operation() {
        implementor.operationImpl();
    }
}

// ConcreteImplementorA 类
class ConcreteImplementorA implements Implementor {
    public void operationImpl() {
        System.out.println("ConcreteImplementorA operationImpl");
    }
}

// ConcreteImplementorB 类
class ConcreteImplementorB implements Implementor {
    public void operationImpl() {
        System.out.println("ConcreteImplementorB operationImpl");
    }
}

// 测试类
public class BridgeTest {
    public static void main(String[] args) {
        RefinedAbstraction abstraction = new RefinedAbstraction(new ConcreteImplementorA()) {};
        abstraction.operation(); // 输出：ConcreteImplementorA operationImpl
        
        abstraction = new RefinedAbstraction(new ConcreteImplementorB()) {};
        abstraction.operation(); // 输出：ConcreteImplementorB operationImpl
    }
}